/* Copyright (C) 2005-2013, Unigine Corp. All rights reserved.
 *
 * File:    fragment_leaf_sample.h
 * Desc:    Mesh leaf sample shader
 * Version: 1.03
 * Author:  Alexander Zapryagaev <frustum@unigine.com>
 *
 * This file is part of the Unigine engine (http://unigine.com/).
 *
 * Your use and or redistribution of this software in source and / or
 * binary form, with or without modification, is subject to: (i) your
 * ongoing acceptance of and compliance with the terms and conditions of
 * the Unigine License Agreement; and (ii) your inclusion of this notice
 * in any version of this software that you use or redistribute.
 * A copy of the Unigine License Agreement is available by contacting
 * Unigine Corp. at http://unigine.com/
 */

/******************************************************************************\
*
* OpenGL/OpenGLES
*
\******************************************************************************/

#ifdef OPENGL || OPENGLES
	
	#ifdef (USE_ALPHA_FADE && ALPHA_FADE) || ANGLE_FADE
		fixed4 diffuse = texture2DAlpha(s_texture_0,s_texcoord_0.xy,s_texcoord_7);
	#else
		fixed4 diffuse = texture2DAlpha(s_texture_0,s_texcoord_0.xy);
	#endif
	
	#ifdef USE_SRGB
		diffuse.xyz *= diffuse.xyz;
	#endif
	
/******************************************************************************\
*
* Direct3D11/Direct3D119
*
\******************************************************************************/

#elif DIRECT3D11 || DIRECT3D119
	
	#ifdef (USE_ALPHA_FADE && ALPHA_FADE) || ANGLE_FADE
		half4 diffuse = texture2DAlpha(s_texture_0,s_sampler_0,IN.texcoord_0.xy,IN.texcoord_7.x);
	#else
		half4 diffuse = texture2DAlpha(s_texture_0,s_sampler_0,IN.texcoord_0.xy);
	#endif
	
	#ifdef USE_SRGB
		diffuse.xyz *= diffuse.xyz;
	#endif
	
#endif
